<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/common/meta.jsp"%>
</head>
<body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false" style="height:40px;padding:10px 20px 0px 20px;">
			<a href="javascript:selectInboxOrder();" class="easyui-linkbutton" data-options="toggle:true,group:'order_data_type'">收到的预约</a>  
	        <a href="javascript:selectSentOrder();" class="easyui-linkbutton" data-options="toggle:true,selected:true,group:'order_data_type'">已发送的预约</a>
	        <a href="javascript:selectInboxOrder(10);" class="easyui-linkbutton" data-options="toggle:true,group:'order_data_type'">未处理的预约</a>
		</div>
		<div data-options="region:'center',border:false" style="padding:10px 20px;">
			<table id="framework_main_order_datagrid"></table>
		</div>
	</div>
<script type="text/javascript">
var orderOptions={
	fit : true,					//充满上层元素
	//border:false,
	remoteSort : true,			//定义是否从服务器给数据排序
	pagination : true,			//True就会在 datagrid 的底部显示分页栏。
	rownumbers : true,			//True就会显示行号的列
	idField : 'id',				//标识字符串 (如果不标明这个属性，getSelections方法不能使用)
	striped : true,				//奇偶行使用不同背景色
       //checkOnSelect : false,		//行选择不映射到复选框
    selectOnCheck : false,		//复选框可以多选
    singleSelect : true,			//之润徐选一行
    url:"${ctx}/order/list_order.do",
	queryParams:{},
	columns:[[  
	           {field:'hostName',title:'店铺',width:150},
	           {field:'status', formatter:frame.getFormatter("UserOrderStatus"), title:'状态',width:120},  
	           {field:'lastModifydate', formatter:frame.getFormatter("Time"),title:'时间',width:120}  
	       ]] 
};
$("#framework_main_order_datagrid").datagrid(orderOptions);

function selectSentOrder() {
	$("#framework_main_order_datagrid").datagrid({
		queryParams:{},
		columns:[[  
		           {field:'hostName',title:'店铺',width:150},
		           {field:'status', formatter:frame.getFormatter("UserOrderStatus"), title:'状态',width:120},  
		           {field:'lastModifydate', formatter:frame.getFormatter("Time"),title:'时间',width:120}
		       ]],
		onClick:function(i, row){
			
		}
	});
}
function selectInboxOrder(status) {
	$("#framework_main_order_datagrid").datagrid({
		queryParams:{orderType:"host", untreated:status},
		columns:[[  
           {field:'userName',title:'来自',width:150},
           {field:'status', formatter:frame.getFormatter("HostOrderStatus"), title:'状态',width:120},  
           {field:'lastModifydate', formatter:frame.getFormatter("Time"),title:'时间',width:120}
       ]] 
	});
}
</script>
</body>
</html>